<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" import="pojo.*,base.*,service.*,java.text.*,java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="jquery/jquery-1.6.1.js"></script>
<script type="text/javascript" src="jquery/jquery.validate.min.js"></script>
<script src="jquery/jscal2.js"></script>
    <script src="jquery/cn.js"></script>
    <script type="text/javascript">
$(function(){
	$("#add").click(function(){
	
	var area=$("#area").val();
	var type=$("#type").val();
	var name=$("#name").val();
	if(area==0){
        alert("请选择餐桌类别");
        return false;
    }
   
   else if(type==0){
    alert("请选择餐桌类型");
       return false;
    }
    
    
    else if(name==""){
    alert("请输入餐桌名")
    $("#namel").focus();
     return false;
     }
    else{$("#form1").submit()}
    
	})
})
</script>

<style type="text/css">

#box{
	border: 5px groove #CDC9C9;
	height: 500px;
	width: 500px;
	margin-left:auto;
	margin-right:auto;
}
#b1{
	height: 50px;
	width: 510px;
	margin-top: 35px;
}

#s{
   height:40px;
   width:490px;
   margin-bottom:5px;
   }
  body{
	margin:0;
	padding:20px;
	background-image:url("images/innerBJ.jpg");
	background-repeat:no-repeat;
	font:80% Arial, Helvetica, sans-serif;
	color:#555;
	line-height:100%;
}  
</style>
<script type="text/javascript"></script>
</head>


<body >
<% request.setCharacterEncoding("UTF-8"); %>
	
<form id=form1" action="action/addTableAction.jsp" method="post">
		<div id="box" >
			  <p class="STYLE2"> 餐桌类别
		                    <select name="area" id="area" style="width:150px;">
                            <option value=0>--请选择--</option>
                            <option value=1>大厅</option>
                            <option value=2>包厢</option>
                            </select>
                            </p>
              <p class="STYLE2"> 餐桌类型
		                    <select name="type" id="type" style="width:150px;"> 
		                    <option value=0>--请选择--</option>             
 <%
                              
	                           TableService ds = new TableService();	
	                           List<TableType> list1 = ds.getTableType();	

	                           for(TableType d:list1){
		                      
			                     out.print("<option value='"+d.getId()+"'>"+d.getName()+"</option>");
	                           } %>
 
 
                             </select>
			  </p>
			  <p class="STYLE2"> 餐桌名称
               <input type="text" name="name" id="name"/>
              </p>
               <p class="STYLE2"> 备注信息
               
               <textarea  name="detail"  id="detail" rows="3" cols="30"></textarea>
               
               
               </p>
			  <br />
			
			   <p align="center">
               <button  type="submit" id="add">确认</button>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value="重置">
                </p>
			  
			</div>
		
		</form>
		
	
</body>
</html>
